clear;
close all;

%% exercise 11a laplace edge detection
img = rgb2gray(double(imread('peppers.png'))/255);

Glaplace = my_laplaceEdge(img);

%% exercise 11b sobel edge detection
img = rgb2gray(double(imread('peppers.png'))/255);

Gsobel = my_sobelEdge(img);

my_plotSobel(img);

%% exercise 11c marrhildreth edge detection
img = rgb2gray(double(imread('peppers.png'))/255);

% The sigma values represent the std. deviation for each gaussian. We
% noticed that values between 2 and 4 are more ideal.
% The threshold limits from which value up will be shown as edge on the
% final image.
sigma0 = 2;
sigma1 = 3;
threshold = 88;
[Gmarr Gsmooth Gfilter] = my_marrhildrethEdge(img, sigma0, sigma1, threshold);

my_plotMarrhildreth(  img, sigma0, sigma1, threshold );
%% exercise 11d canny (matlab) edge detection
img = rgb2gray(double(imread('peppers.png'))/255);

%The two chosen values for the threshold. Started from trial and error, and
%the followed the standard recommendation from Matlab: threshL = 0.4 *
%threshH
threshL = 0.08;
threshH = 0.22;
Gcanny = my_cannyEdge(img, threshL, threshH);


%% present results

compareEdges(img,Glaplace,Gsobel,Gmarr,Gcanny);
